#ifndef STANDARDSYSTEMTRAYDIALOG_H
#define STANDARDSYSTEMTRAYDIALOG_H

#include <QCloseEvent>
#include <QWidget>
#include <QTranslator>
#include <QPixmap>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QIcon>

#include <pluginui/pluginui_global.h>
#include <pluginui/activator/GuiPluginActivator.h>
#include <plugin/plugin/PluginContext.h>
#include <plugin/util/PluginVersion.h>
#include <plugin/util/AbstractSecurityContextHandler.h>

namespace antu
{
namespace plugin
{
namespace ui
{
class PLUGINUISHARED_EXPORT StandardSystemTrayDialog : public QWidget
{
    Q_OBJECT

private:
	PluginContext* m_pContext;
	GuiPluginActivator* m_pActivator;
	QTranslator m_oTranslator;
	PluginVersion m_oVersion;
	QString m_sSerial;
	QPixmap m_oAboutImage;
	QSystemTrayIcon* m_pSystemTrayIcon;
	QMenu* m_pSystemTrayMenu;

public:
    StandardSystemTrayDialog(PluginContext* pContext, AbstractSecurityContextHandler* pHandler, const QIcon& icon, QWidget* parent = nullptr);

protected:
	virtual void closeEvent(QCloseEvent * pEvent);

	void setupMenu();
	void postSetupMenu();

private slots:
	void pluginListClicked();
	void aboutClicked();
	void showClicked();
	void trayActivated(QSystemTrayIcon::ActivationReason reason);
};
}
}
}

#endif // STANDARDSYSTEMTRAYDIALOG_H
